package StudentManagement;

public class Teacher {
    private String name;
    private int age;

    public Teacher(String name){
        this.name = name;
    }
    public String getName(){
        return name;
    }
    public void setName(String name){
        this.name=name;
    }
    public int getAge(){
        return age;
    }
    public void setAge(int age){
        if (age >= 22 && age <= 65) {
            this.age = age;
        } else {
            System.out.println("年龄不合法（必须0~100分）");
        }
    }
}
